package model

import (
	"gorm.io/gorm"
	"time"
)

type EduSubject struct {
	ID        int            `json:"id"`
	Title     string         `json:"title"`
	Sort      int            `json:"sort"`
	CreatedAt time.Time      `json:"created_at"`
	UpdatedAt time.Time      `json:"updated_at"`
	DeletedAt gorm.DeletedAt `json:"deleted_at"`

	ParentID int
	Subjects []EduSubject `gorm:"foreignkey:ParentID" json:"children"`
}

func (EduSubject) TableName() string {
	return "edu_subject"
}
